#ifndef SEGYVIEW_H
#define SEGYVIEW_H

#include <QWidget>
#include <form/segyproperdialog.h>
#include <datatype/segy.h>
#include <plot/plotsettings.h>
#include <QSettings>
#include <QString>
#include <QFileDialog>
#include  "QStylePainter"
#include <QVector>
#include <QMouseEvent>
#include <QMessageBox>
#include "segysettingdialog.h"
namespace Ui {
class SegyView;
}

class SegyView : public QWidget
{
    Q_OBJECT
    
public:
    explicit SegyView(QWidget *parent = 0);
    ~SegyView();
    
    void paintEvent(QPaintEvent *);
    QSize sizeHint() const;
    QSize minimumSizeHint() const;
    void refreshPixmap();
    void drawGrid(QPainter *painter);
    void resizeEvent(QResizeEvent *);
    void drawCurves(QPainter *painter);

private slots:
    void on_fileButton_clicked();
    void on_horizontalScrollBar_sliderReleased();
    void on_verticalScrollBar_sliderReleased();
    void on_horizontalSlider_actionTriggered(int action);
    void on_horizontalSlider_sliderReleased();
    void on_ButtonSetting_clicked();

private:
    Ui::SegyView *ui;
    bool sliderReleased;
    QString fileName;
    int traceNum;
    int stepTrace;
    QPixmap pixmap;
    QRect rect;
    enum { Margin = 50 };
    PlotSettings settings ;
    int freq;
    QList < QVector<QPointF> > list;
    int horizontalValue;
    int verticalValue;
    bool isreadData;
    int acc;
    int stepTime;
    int totalTime;
};

#endif // SEGYVIEW_H
